(function(){
	if (!loadItem("web3js_wallet")){
		alert("您还没有内置账号，请先创建");
        goto("wallet/addnew");
	}else{
    	getNode("pswd1").onkeyup=function(e){
            if (13== e.keyCode) go();
        };
        setEye(1);
        getNode("ok").onclick = go;
        async function go(){
            var pswd1=getNode("pswd1").value;
            if (pswd1.length<6){
                setNodeText("errmsg","密码最少6位");
                return;
            }
            setLoading(1);
            var rtn = await walletLogin(pswd1);
            if(rtn) goto("home");
            else setNodeText("errmsg","密码不正确");
            setLoading(0);
        };
    }
})();